ChartMarkProps defines a set of visual and behavioral modifiers applicable to individual chart marks such as bars, lines, or areas. These modifiers allow developers to customize the appearance, layout, and dynamic behavior of chart elements in BarChart, LineChart, AreaChart, and other mark-based components.
foregroundStyleSpecifies the fill style of the chart content.
Type: ShapeStyle | DynamicShapeStyle
Example:
opacitySets the opacity of the mark, ranging from 0.0 (fully transparent) to 1.0 (fully opaque).
Type: number
Example:
cornerRadiusSets the corner radius for shapes such as bars or capsules.
Type: number
Example:
lineStyleApplies stroke styles for line marks.
Type: StrokeStyle
Structure:
Example:
interpolationMethodControls how lines or areas interpolate between data points.
Type: ChartInterpolationMethod
Options:
"cardinal", "catmullRom", "linear", "monotone", "stepCenter", "stepEnd", "stepStart"
Example:
alignsMarkStylesWithPlotAreaDetermines whether styles align with the chart’s plot area.
Type: boolean
Example:
symbolSets a symbol type or a custom view as the plotting symbol.
Type: ChartSymbolShape | VirtualNode
Options:
"circle", "square", "triangle", "diamond", "cross", "plus", "asterisk", "pentagon"
Example:
symbolSizeControls the symbol’s size.
Type: number | { width: number; height: number }
Example:
annotationAdds an annotation view positioned relative to a mark.
Type: VirtualNode | { position?, alignment?, spacing?, overflowResolution?, content }
Structure:
Example:
AnnotationPositionDefines where the annotation is placed relative to the mark.
Type: string
Values:
"automatic""top", "topLeading", "topTrailing""bottom", "bottomLeading", "bottomTrailing""leading", "trailing""overlay" (overlay the mark itself)AnnotationOverflowResolutionStrategySpecifies how to handle annotation layout overflow.
Type: string
Values:
"automatic": Selects the best resolution strategy automatically"fit": Adjusts the annotation to stay within the boundary"fitToPlot": Fits annotation within the plot area"fitToChart": Fits within the full chart bounds"fitToAutomatic": Automatically chooses between chart and plot bounds"padScale": Extends the chart scale to fit the annotation"disabled": Disables overflow resolution (allows clipping)clipShapeApplies a clipping shape to the mark.
Type: 'rect' | 'circle' | 'capsule' | 'ellipse' | 'buttonBorder' | 'containerRelative'
Example:
shadowAdds a drop shadow to the mark.
Type:
Example:
blurApplies a Gaussian blur effect.
Type: number
Example:
zIndexControls the rendering order of the mark relative to others.
Type: number
Example:
offsetOffsets the mark in one or more dimensions.
Supported formats:
{ x, y }{ x, yStart, yEnd }{ xStart, xEnd, y }{ xStart, xEnd, yStart, yEnd }Example:
xxxBy)These properties dynamically bind mark appearance or position to data fields. They should not be used in combination with their corresponding static properties (e.g. foregroundStyleBy vs. foregroundStyle).
foregroundStyleByMaps a data field to a foreground style.
Type: string | number | Date | { value, label }
Example:
lineStyleByMaps a data field to a line style.
Example:
positionByMaps a data field to mark position and axis alignment.
Type:
Example:
MarkDimensionControls the spacing or sizing behavior of the mark within its axis.
Type: "automatic" or an object:
Explanation:
"automatic": Lets the system determine the size"inset": Shrinks the size by an inset margin"fixed": Fixed screen-space size (in points)"ratio": Relative to available axis spacing (0 to 1)symbolByMaps a field to different symbol shapes.
Example:
symbolSizeByMaps a field to symbol size.
Example: